<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue-2.4.0.js"></script>
    <link rel="stylesheet" href="./lib/bootstrap-3.3.7.css">
    <link rel="stylesheet" href="./lib/animate.css">

    <style>
        .fade-enter-active,
        .fade-leave-active {
            transition: all 0.8s ease;
        }
        
        .fade-enter,
        .fade-leave-to {
            opacity: 0;
            transform: translateX(200px);
        }
    </style>

</head>

<body>
    <div id="app">
        <button type="button" class="btn btn-primary" @click="show =!show">动画来了</button>
        <!-- 方法一 -->
        <!-- 1. 使用transition将需要东的元素包起来 -->
        <!-- 2. 自定义两组动画样式, name自定义class前缀，默认v-->
        <!-- <transition name="fade" mode="">
            <h3 v-if="show">这里体现动画效果</h3>
        </transition> -->

        <!-- 方法二：使用animate -->
        <transition enter-active-class="animated bounceIn" leave-active-class="animated bounceOut">
            <h3 v-if="show">这里体现动画效果</h3>
        </transition>

        <transition enter-active-class="bounceIn" leave-active-class="bounceOut">
            <h3 v-if="show" class="animated">这里体现动画效果</h3>
        </transition>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                show: true
            },
            methods: {}
        });
    </script>
</body>

</html>